package com.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.base.mapper.voipmapper.RegisterinfoesMapper;
import com.base.po.sqlparam.RegisterinfoesExamplePage;
import com.base.po.voip.Registerinfoes;
import com.base.po.voip.RegisterinfoesExample;
import com.base.service.RegisterinfoesService;
import com.base.utils.Page;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("registerinfoesService")
public class RegisterinfoesServiceImpl implements RegisterinfoesService {
	@Autowired
	RegisterinfoesMapper callbackinfoesMapper;

	@Override
	public int countByExample(RegisterinfoesExample example) {
		return callbackinfoesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(RegisterinfoesExample example) {
		return callbackinfoesMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return callbackinfoesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String mobile, String registerip, String address, String parentid, String mobileaddress,
			Boolean datastatus) {
		Registerinfoes record = new Registerinfoes(Produce.getUUID(), mobile, Produce.getNowDate(), registerip, address,
				parentid, mobileaddress, datastatus);
		return callbackinfoesMapper.insert(record);
	}

	@Override
	public int insertSelective(Registerinfoes record) {
		return callbackinfoesMapper.insertSelective(record);
	}

	@Override
	public List<Registerinfoes> selectByExample(RegisterinfoesExample example) {
		return callbackinfoesMapper.selectByExample(example);
	}

	@Override
	public List<Registerinfoes> selectByExamplePage(RegisterinfoesExamplePage example) {
		return callbackinfoesMapper.selectByExamplePage(example);
	}

	@Override
	public Registerinfoes selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return callbackinfoesMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(Registerinfoes record, RegisterinfoesExample example) {
		return callbackinfoesMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Registerinfoes record, RegisterinfoesExample example) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Registerinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Registerinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Registerinfoes> selectByParentid(Page page, String parentid, String mobile, String dateFrom,
			String dateTo) {
		
		return callbackinfoesMapper.selectByParentid(page, parentid, mobile, dateFrom, dateTo);
	}

	@Override
	public int countByParentid(String parentid, String mobile, String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.countByParentid(parentid, mobile, dateFrom, dateTo);
	}

}
